<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of StatsDetailsService
 *
 * @author ingeni
 */
class StatsDetailsService {
    public function display(ContextExecution $p_contexte){
        //$userid = $p_contexte->getUser()->userId;
        $numeroCompte = $p_contexte->m_dataRequest->getData('numeroCompte');
        $mode = $p_contexte->m_dataRequest->getData('mode');
        $clause="noCompte='$numeroCompte'";
        
        $fluxid=$p_contexte->m_dataRequest->getData('fluxId');
        $clause .=" AND fluxid=$fluxid";
        if($mode=='releve') {
            $recReleve=$p_contexte->m_dataRequest->getData('noReleve');
            $clause .= " AND noreleve ='$recReleve'";
        }else if($mode == 'annee') {
            $recAnnee=$p_contexte->m_dataRequest->getData('annee');
            $clause .= " AND date like concat('$recAnnee','%')";
        }
        
        
        $listOpe = new ListObject();
        $listOpe->name='ListeOperations';
        $listOpe->request('Operation', $clause. ' order by date DESC, operationId DESC');
        $p_contexte->addDataBlockRow($listOpe);
        
        $flux = new Flux();
        $flux->fluxId=$fluxid;
        $flux->load();
        $p_contexte->addDataBlockRow($flux);
    }
}

?>
